import serve from './index'
// 按需导出

// 获取页码数
export function getPages(name, departmentName) {
    return serve({
        url: '/admin/major/page/count',
        method: 'get',
        params: {
            name: name,
            departmentName: departmentName
        }
    })
}

// 搜索
export function getList(name, departmentName,page) {
    return serve({
        url: '/admin/major/page/' + page,
        method: 'get',
        params: {
            name: name,
            departmentName: departmentName
        }
    })
}

// 搜索所有系
export function getListAll() {
    return serve({
        url: '/admin/department/names',
        method: 'get',
    })
}

// 添加
export function ADDList(name, departmentId) {
    return serve({
        url: '/admin/major',
        method: 'post',
        data: {
            name: name,
            departmentId: departmentId,
            id: -1
        }
    })
}

// 更改
export function changeorno(name, departmentId, id) {
    return serve({
        url: '/admin/major',
        method: 'put',
        data: {
            name: name,
            departmentId: departmentId,
            id: 1
        }
    })
}

// 删除
export function deleted(id) {
    return serve({
        url: '/admin/major/' + id,
        method: 'delete',
    })
}